//
//  singleton.h
//  XRmenu
//
//  Created by shrek on 11-11-23.
//  Copyright 2011年 foxhis. All rights reserved.
//

#import "AllInclude.h"
@class PluPlu;

@interface singleton : NSObject<AVAudioPlayerDelegate> {
	NSString *uistyle;	//当前运行的界面风格
	NSString *language; //当前运行的语言
	NSString *currentBookID;	// 当前默认菜本编号
	NSString *currentOrderNo;	// 当前操作的单据号
	NSInteger currentBatchNo;	// 当前批号
	
	NSInteger relateDishLayerStatus;  //0-不显示 1-展开显示 2-小图展示
	
	NSDictionary *allconfig;	// 总的配置文件
	NSDictionary *translate;	// 图文翻译用字典
	NSMutableArray *dishdata;	// 当前条件下的dish数据
	
	NSMutableArray *filteredListContent;	// 工具栏搜索历史记录，须持久化保存
	AVAudioPlayer *bgMusic;
    
    
    //XRmenu
    BOOL isViewRemoveFromLef;
    BOOL isAnimating;
    NSMutableArray *pluMenus;                     //所有大类对象的数组
    NSInteger currentMenuIndex;                   //当前显示的大类下标
    NSMutableArray *pluSorts;                     //当前大类名称数组
    NSInteger currentSortIndex;                   //当前小类的下标
    NSMutableArray *myOrders;                     //当前已点菜品数组
    NSMutableArray *pluPlus;                      //当前显示的小类下面的菜品对象数组
    PluPlu *currentPluPlu;                        //当前选中的菜品
    NSInteger currentPluIndex;                    //当前选中的菜品在数组里的下标
    NSInteger lastPluIndex;                       //上次显示的菜品下标
    NSString *udid;                               //本机的唯一编号
    
    NSMutableArray *allCommendPlu;                // 所有的推荐菜数组
    NSMutableArray *allTables;                    // 所有桌号
}

+(singleton *) sharedSingleton;


@property (nonatomic,retain) NSString *language;
@property (nonatomic,retain) NSString *uistyle;
@property (nonatomic,retain) NSString *currentBookID;
@property (nonatomic,retain) NSString *currentOrderNo;
@property (nonatomic,assign) NSInteger currentBatchNo;
@property (nonatomic,retain) NSDictionary *allconfig;
@property (nonatomic,retain) NSDictionary *translate;
@property (nonatomic,retain) NSMutableArray *dishdata;
@property (nonatomic,retain) NSMutableArray *filteredListContent;
@property (nonatomic,retain) AVAudioPlayer *bgMusic;
@property (nonatomic,assign) NSInteger relateDishLayerStatus;

@property (nonatomic,assign) BOOL isViewRemoveFromLef;
@property (nonatomic,assign) BOOL isAnimating;
@property (nonatomic,retain) NSMutableArray *pluSorts;
@property (nonatomic,assign) NSInteger currentMenuIndex;
@property (nonatomic,retain) NSMutableArray *pluMenus;
@property (nonatomic,retain) NSMutableArray *myOrders;
@property (nonatomic,retain) NSMutableArray *pluPlus;
@property (nonatomic,retain) PluPlu *currentPluPlu;
@property (nonatomic,assign) NSInteger currentPluIndex;
@property (nonatomic,assign) NSInteger currentSortIndex;
@property (nonatomic,assign) NSInteger lastPluIndex;
@property (nonatomic,retain) NSString *udid;
@property (nonatomic,retain) NSMutableArray *allCommendPlu;
@property (nonatomic,retain) NSMutableArray *allTables;

-(void) playSoundOnEvent:(NSString *)mp3File;
-(void) stopSoundOnEvent;

-(void) initPluMenus;
-(void) getAllMyOrder;
-(void) updateCurrentPluIndex:(NSInteger) newCurrentIndex;
-(void) updateCurrentMenuIndex:(NSInteger) newCurrentMenuIndex;
-(void) updateCurrentSortIndex:(NSInteger) newCurrentSortIndex;

-(NSMutableArray*)getDataWithKey:(NSString*)aString;
-(NSMutableArray*)getDataWithSort:(NSInteger)aSort sortId:(NSString*)aSortId;
@end
